/**
 * @author TrinhNX
 */
public class Euler015 {
	public static void main(String[] args) {
		Euler015 main = new Euler015();
		System.out.println(main.test(20, 20));
		// f0 = 1
		// f1 = 1 1
		// f2 = 1 2 1
		// fn = 1 3 3 1
	}

	private long test(int m, int n) {
		if (m == 0 || n == 0) {
			return 1;
		}
		if (m == 1) {
			return n + 1;
		}
		if (n == 1) {
			return m + 1;
		}
		return 2 * test(m - 1, n - 1) + test(m, n - 2) + test(m - 2, n);
	}
}